\(\int \sec ^2(c+d x) (a+b \tan (c+d x))^n \, dx\) [648]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [F(-2)]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 26 \[ \int \sec ^2(c+d x) (a+b \tan (c+d x))^n \, dx=\frac {(a+b \tan (c+d x))^{1+n}}{b d (1+n)} \]

[Out]

(a+b*tan(d*x+c))^(1+n)/b/d/(1+n)

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3587, 32} \[ \int \sec ^2(c+d x) (a+b \tan (c+d x))^n \, dx=\frac {(a+b \tan (c+d x))^{n+1}}{b d (n+1)} \]

[In]

Int[Sec[c + d*x]^2*(a + b*Tan[c + d*x])^n,x]

[Out]

(a + b*Tan[c + d*x])^(1 + n)/(b*d*(1 + n))

Rule 32

Int[((a_.) + (b_.)*(x_))^(m_), x_Symbol] :> Simp[(a + b*x)^(m + 1)/(b*(m + 1)), x] /; FreeQ[{a, b, m}, x] && N
eQ[m, -1]

Rule 3587

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(b*f), Subst
[Int[(a + x)^n*(1 + x^2/b^2)^(m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && NeQ[a^2 + b
^2, 0] && IntegerQ[m/2]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int (a+x)^n \, dx,x,b \tan (c+d x)\right )}{b d} \\ & = \frac {(a+b \tan (c+d x))^{1+n}}{b d (1+n)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.09 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.00 \[ \int \sec ^2(c+d x) (a+b \tan (c+d x))^n \, dx=\frac {(a+b \tan (c+d x))^{1+n}}{b d (1+n)} \]

[In]

Integrate[Sec[c + d*x]^2*(a + b*Tan[c + d*x])^n,x]

[Out]

(a + b*Tan[c + d*x])^(1 + n)/(b*d*(1 + n))

Maple [A] (verified)

Time = 8.99 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.04

method result size
derivativedivides \(\frac {\left (a +b \tan \left (d x +c \right )\right )^{1+n}}{b d \left (1+n \right )}\) \(27\)
default \(\frac {\left (a +b \tan \left (d x +c \right )\right )^{1+n}}{b d \left (1+n \right )}\) \(27\)

[In]

int(sec(d*x+c)^2*(a+b*tan(d*x+c))^n,x,method=_RETURNVERBOSE)

[Out]

(a+b*tan(d*x+c))^(1+n)/b/d/(1+n)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 64 vs. \(2 (26) = 52\).

Time = 0.27 (sec) , antiderivative size = 64, normalized size of antiderivative = 2.46 \[ \int \sec ^2(c+d x) (a+b \tan (c+d x))^n \, dx=\frac {{\left (a \cos \left (d x + c\right ) + b \sin \left (d x + c\right )\right )} \left (\frac {a \cos \left (d x + c\right ) + b \sin \left (d x + c\right )}{\cos \left (d x + c\right )}\right )^{n}}{{\left (b d n + b d\right )} \cos \left (d x + c\right )} \]

[In]

integrate(sec(d*x+c)^2*(a+b*tan(d*x+c))^n,x, algorithm="fricas")

[Out]

(a*cos(d*x + c) + b*sin(d*x + c))*((a*cos(d*x + c) + b*sin(d*x + c))/cos(d*x + c))^n/((b*d*n + b*d)*cos(d*x +
c))

Sympy [F]

\[ \int \sec ^2(c+d x) (a+b \tan (c+d x))^n \, dx=\int \left (a + b \tan {\left (c + d x \right )}\right )^{n} \sec ^{2}{\left (c + d x \right )}\, dx \]

[In]

integrate(sec(d*x+c)**2*(a+b*tan(d*x+c))**n,x)

[Out]

Integral((a + b*tan(c + d*x))**n*sec(c + d*x)**2, x)

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.00 \[ \int \sec ^2(c+d x) (a+b \tan (c+d x))^n \, dx=\frac {{\left (b \tan \left (d x + c\right ) + a\right )}^{n + 1}}{b d {\left (n + 1\right )}} \]

[In]

integrate(sec(d*x+c)^2*(a+b*tan(d*x+c))^n,x, algorithm="maxima")

[Out]

(b*tan(d*x + c) + a)^(n + 1)/(b*d*(n + 1))

Giac [F(-2)]

Exception generated. \[ \int \sec ^2(c+d x) (a+b \tan (c+d x))^n \, dx=\text {Exception raised: TypeError} \]

[In]

integrate(sec(d*x+c)^2*(a+b*tan(d*x+c))^n,x, algorithm="giac")

[Out]

Exception raised: TypeError >> an error occurred running a Giac command:INPUT:sage2:=int(sage0,sageVARx):;OUTP
UT:Unable to divide, perhaps due to rounding error%%%{1,[0,1,0,0]%%%} / %%%{1,[0,0,1,1]%%%} Error: Bad Argumen
t Value

Mupad [B] (verification not implemented)

Time = 5.25 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.96 \[ \int \sec ^2(c+d x) (a+b \tan (c+d x))^n \, dx=\left \{\begin {array}{cl} \frac {\ln \left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}{b\,d} & \text {\ if\ \ }n=-1\\ \frac {{\left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}^{n+1}}{b\,d\,\left (n+1\right )} & \text {\ if\ \ }n\neq -1 \end {array}\right . \]

[In]

int((a + b*tan(c + d*x))^n/cos(c + d*x)^2,x)

[Out]

piecewise(n == -1, log(a + b*tan(c + d*x))/(b*d), n ~= -1, (a + b*tan(c + d*x))^(n + 1)/(b*d*(n + 1)))